<template>
  <div class="contact">
    <!-- 核心团队模块 -->
    <div class="core-team">
      <h2>核心团队</h2>
      <div class="team-grid">
        <div class="team-card">
          <img src="https://picsum.photos/100/100?random=30" alt="张钰玺" class="team-avatar" />
          <h3>张钰玺</h3>
          <p class="team-title">创始人 & CEO</p>
          <p class="team-desc">10年电商行业经验，专注于用户体验和商业模式创新。</p>
        </div>
        <div class="team-card">
          <img src="https://picsum.photos/100/100?random=31" alt="杨天宇" class="team-avatar" />
          <h3>杨天宇</h3>
          <p class="team-title">技术总监</p>
          <p class="team-desc">资深全栈工程师，负责平台技术架构和产品开发。</p>
        </div>
      </div>
    </div>

    <!-- 发展历程模块 -->
    <div class="development-history">
      <h2>发展历程</h2>
      <div class="timeline">
        <div class="timeline-item" v-for="item in timelineData" :key="item.id">
          <div class="timeline-date">{{ item.date }}</div>
          <div class="timeline-content">
            <h3>{{ item.title }}</h3>
            <p>{{ item.desc }}</p>
          </div>
        </div>
      </div>
    </div>

    <!-- 原有联系我们模块 -->
    <div class="contact-info">
      <h2>联系我们</h2>
      <div class="info-item">
        <img src="https://picsum.photos/30/30?random=10" alt="邮箱" class="info-icon" />
        <div>
          <h3>邮箱地址</h3>
          <p>contact@vueshop.com</p>
        </div>
      </div>
      <div class="info-item">
        <img src="https://picsum.photos/30/30?random=11" alt="电话" class="info-icon" />
        <div>
          <h3>客服热线</h3>
          <p>400-888-9999</p>
        </div>
      </div>
      <div class="info-item">
        <img src="https://picsum.photos/30/30?random=12" alt="地址" class="info-icon" />
        <div>
          <h3>公司地址</h3>
          <p>北京市朝阳区科技园创新大厦</p>
        </div>
      </div>
    </div>

    <!-- 原有留言反馈模块 -->
    <div class="feedback-form">
      <h2>留言反馈</h2>
      <form @submit.prevent="submitForm">
        <input type="text" placeholder="您的姓名" v-model="form.name" class="form-input" />
        <input type="email" placeholder="邮箱地址" v-model="form.email" class="form-input" />
        <textarea placeholder="留言内容" v-model="form.message" class="form-textarea"></textarea>
        <button type="submit" class="form-btn">发送消息</button>
      </form>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const form = ref({
  name: '',
  email: '',
  message: ''
})

// 发展历程模拟数据
const timelineData = ref([
  { id: 1, date: '2023.01', title: '平台创立', desc: 'Vue商城正式成立，开始搭建核心技术团队。' },
  { id: 2, date: '2023.06', title: '产品上线', desc: '平台正式上线，推出首批精选商品类目。' },
  { id: 3, date: '2023.12', title: '用户突破', desc: '注册用户突破10万，月活跃用户持续增长。' }
])

const submitForm = () => {
  if (!form.value.name || !form.value.email || !form.value.message) {
    alert('请填写完整信息')
    return
  }
  console.log('提交的表单数据：', form.value)
  alert('留言提交成功！我们将尽快回复您。')
  form.value = { name: '', email: '', message: '' }
}
</script>

<style scoped>
/* 核心团队样式（保持不变） */
.core-team {
  width: 100%;
  margin-bottom: 40px;
}
.core-team h2 {
  text-align: center;
  font-size: 28px;
  margin-bottom: 32px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}
.core-team h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: #6a4a9e;
  border-radius: 3px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.team-card {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
}
.team-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
}
.team-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
}
.team-title {
  color: #6a4a9e;
  font-weight: bold;
  margin-bottom: 8px;
}
.team-desc {
  color: #666;
  font-size: 14px;
}

/* 发展历程样式 */
.development-history {
  width: 100%;
  margin-bottom: 40px;
}
.development-history h2 {
  text-align: center;
  font-size: 28px;
  margin-bottom: 32px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}
.development-history h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: #6a4a9e;
  border-radius: 3px;
}
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
/* 时间轴竖线 */
.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background-color: #6a4a9e;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}
.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
}
/* 时间点样式 */
.timeline-item::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background-color: white;
  border: 4px solid #6a4a9e;
  border-radius: 50%;
  top: 15px;
  z-index: 1;
}
/* 左侧时间轴 */
.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}
.timeline-item:nth-child(odd)::after {
  right: -8px;
}
/* 右侧时间轴 */
.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
}
.timeline-item:nth-child(even)::after {
  left: -8px;
}
.timeline-date {
  background-color: #6a4a9e;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
}
.timeline-content h3 {
  font-size: 18px;
  margin-bottom: 4px;
}
.timeline-content p {
  color: #666;
  font-size: 14px;
}

/* 原有样式保持不变 */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px 20px;
}
.contact-info, .feedback-form {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.contact-info h2, .feedback-form h2 {
  margin-bottom: 24px;
  font-size: 24px;
}
.info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}
.info-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f0f0f0;
  object-fit: contain;
}
.info-item h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
.info-item p {
  color: #666;
}
.form-input, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
}
.form-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #4a6fa5, #6a4a9e);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
@media (max-width: 768px) {
  .contact {
    grid-template-columns: 1fr;
  }
  /* 移动端时间轴适配 */
  .timeline::after {
    left: 31px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
    text-align: left;
  }
  .timeline-item::after {
    left: 18px;
  }
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    left: 0;
    text-align: left;
  }
}
</style>